perm filename TANGLE.ERR[WEB,ALS] blob
sn#621854 filedate 1981-11-04 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00003 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 Corrections applicable to TANGLE.WEB
C00009 00003 ***********
C00012 ENDMK
C⊗;
Corrections applicable to TANGLE.WEB
The following corrections fall into two classes. Some were required to fix
TANGLE so that it would be accepted by WEAVE. TANGLE.WEB[WEB,ALS] contains
these corrections only. Others were made to remove superfluous BEGINs and
ENDs. TANGLX.WEB[WEB,ALS] contains all of the indicated corrections.Line
numbers are in terms of the unaltered text.
All together there are 36 examples of BEGIN BEGIN BEGIN triplets, 27 other
BEGIN BEGIN pairs and some 18 cases of isolated but unnecessary BEGINs in
TANGLE.PAS[WEB,DEK]. In terms of totals, there are 117 superfluous
BEGINs as compared with 262 necessary BEGINs, and of course similar
numbers for ENDs. Most of these extra BEGINs and
ENDs are in error-message situations where their presence is unimportant,
although they may make the code longer than
necessary and they are unsightly. The 15 extra BEGINs and ENDs because of
app and app_repl are more significant.
Of course, a good compiler should simply ignore unneeded BEGINs and ENDs,
but it may mot be safe to expect this to happen.
I have chosen to define new terms ex_print_nl, ex_err_print, and ex_app
rather than of defining the reverse, be_print_nl, be_err_print and be_app,
for the case where BEGIN and END are included, since this is apt to lead
to fewer fatal absent-minded types of errors. Conscious action is then
required to prevent the inclusion of a BEGIN and END and an oversight will
then only result in the inclusion of an unneessary BEGIN-END pair rather
than in a possible fatal omission where the BEGIN-END pair is required.
In the case of app_repl, there were no uses where the BEGIN and END were
required, so they were simply removed.
page 3 line 1
Replace \.{TANGLE} with TANGLE
page 4 line 18
The definition print_nl is used 15 times. In all but 2 of these
locations the enclosing BEGIN and END are superfluous. It is also used
in the err_print definition which adds 34 usages.
So introdue a new definition, after line 20, as follows:
@d ex_print_nl(#)== {similar to print_nl but no begin and end}
write_ln(tty); print(#);
and change print¬nl to ex_print_nl in the following locations:
page 4 line 56
page 4 line 86
page 5 line 32 (see below)
page 7 line 202
page 10 line 163
page 10 line 193
page 12 line 8
page 12 line 13
page 13 line 33
page 14 line 155
page 19 line 30
page 19 line 31
page 19 line 32
page 5 line 32
The definition err_print is used 34 times. It should use ex_print_nl in
all cases. In 19 of these locations the enclosing BEGIN and END in the
definition are superfluous while in 15 locations they are needed. All
together some 65 extra BEGINs and ENDs are introduced.
So modify @d err_print to read:
@d err_print(#)==begin ex_print_nl(#); error;
end
introduce an additional definition as follows:
@d ex_err_print(#)==ex_print_nl(#); error;
and replace err_print by ex_err_print in the following locations:
page 5 line 91
page 5 line 96
page 7 line 146
page 8 line 29
page 11 line 134
page 13 line 151
page 13 line 164
page 14 line 81
page 14 line 126
page 14 line 148
page 15 line 36
page 15 line 70
page 16 line 56
page 16 line 71
page 16 line 83
page 17 line 32
page 17 line 44
page 17 line 56
page 17 line 82
The module @ @<Set $c$...@>= has an extra BEGIN aand END.
So:
page 8 line 44 unneeded BEGIN deleted
line 54 unneeded matching END deleted
page 9 line 47 Replaced |@@'| with |@'|
page 10 line 22 A missing \ was inserted before the initial yskip.
page 10 line 146 WEAVE doesn't like @<Expand module $a-@'24000$, |goto restart|@>
change to @<Expand module |a-@'24000 , goto restart|@>
page 10 line 159 change to @<Expand module ...@>=
page 10 line 231 removed enclosing BEGIN and END.
page 11 line 71 Replaced `\.{(x-15+19-2)' with `\.{(x-15+19-2)}'
page 11 line 72 Weave wrongly broke this line within \hfil. I fixed
matters by breaking it correctly, but WEAVE should be smarter.
page 11 line 148 Introduce new definition
@d ex_app(#)==out_buf[out_ptr]←#; incr(out_ptr);
page 11 line 154 change app_repl to ex_app_repl
page 11 line 205 change app_repl to ex_app_repl
page 11 line 301 change app_repl to ex_app_repl
page 11 line 305 change app_repl to ex_app_repl (in 3 places)
***********
The following are in locations that require the BEGIN and END
page 5 line 52
@ @<Print error location based on input buffer@>=
begin print_ln('. (p.', page:0, ',l.', line:0, ')');
page 5 line 71
@ @<Print error location based on output...@>=
begin print_ln('. (l.',line:0,')');
page 7 line 100
@ @<Compare name $p$...@>=
begin i←id_first; k←byte_start[p];
page 7 line 108
@ @<Update the tables...@>=
begin if ((p≠name_ptr)∧(t≠normal)∧(ilk[p]=normal)) ∨
page 7 line 122
@<Compute the secondary...@>=
begin i←id_first; s←0; h←0;
page 7 line 144
@<Give double...@>= {now |p≠name_ptr| and |t≠normal|}
begin if ilk[p]=normal then
page 7 line 167
@<Enter a new identifier...@>=
begin if (t=normal)∧(buffer[id_first]≠"""") then
page 7 line 208
@ @<Define and output a new string...@>=
begin ilk[p]←numeric; {strings are like numeric macros}
page 8 line 43
page 11 line 220
@ @<Reduce |sign_val_val|...@>=
begin if (t=frac)∨(@<contribution is \.* or \./ or \.{DIV} or \.{MOD}@>) then
page 9 line 95
@ @<Display two-byte...@>=
begin incr(k);
page 10 line 159
@<Expand module $a-...@>=
begin a←a-@'24000;
page 10 line 168
@ @<Expand macro ...@>=
begin case ilk[a] of
page 10 line 209
@<Remove a parameter...@>=
begin
page 10 line 221
@<Start scanning...@>=
begin push_level(name_ptr-1); goto restart;
page 12 line 123
@<Send a string...@>=
begin k←1; out_contrib[1]←"'";
page 14 line 103
@ @<Scan the module name...@>=
begin @<Put module name into |module[1..k]|@>;
page 15 line 69
@ @<Signal error, flush rest...@>=
begin err_print('! Improper numeric definition will be flushed');
page 16 line 76
@ @<Copy a string...@>=
begin b←"'";